<%@page import="java.util.*"%>
<%@page import="DTL.*"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<html>
    <head>

        <style type="text/css">
            body p, table {
                font-family: Verdana, Geneva, sans-serif;
                font-size:10px;
            }
            body {
                margin-left: 0px;
                margin-top: 0px;
                margin-right: 0px;
                margin-bottom: 0px;
            }
            tr.article:hover {
                background-color:RGB(144,195,68);
            }
            #navigation { 
                margin: 0 ; 
                padding: 0 ; 
                list-style: none ; 
                text-align: left ; 
            }
            #navigation li { 
                display: inline ; 
                margin-right: 2px ; 
                color: #fff ; 
                background:#8CC63E;
                font-size:12px;
            }
            #navigation li a { 
                padding: 2px 20px ; 
                background: #8CC63E ; 
                color: #fff ;  
                font: "Verdana",Arial,sans-serif ; 
                line-height: 1em ; 
                text-align: center ; 
                text-decoration: none;
            }
            #navigation li a:hover, #navigation li a:focus, #navigation li a:active { 
                background: #060 ;
            }
        </style>

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <link rel="icon" type="image/png" href="img/bmg_tr.gif" />
        <title>Build More Green: Votre panier</title>
    </head>

    <body>    
        <div align="center">

            <table width="838" height="100%" border="0" cellpadding="5">
                <tr>
                    <td width="10" rowspan="3" align="center" background="img/border_l.gif"></td>
                    <td width="800" height="120"><table width="100%" border="0" cellpadding="5">
                            <tr>
                                <td height="120"><img src="img/logo.jpg" alt="" width="255"></td>
                                <td><table width="100%" border="0" align="center" cellpadding="5">
                                        <tr>
                                            <td colspan="2" bgcolor="#8CC63E"><b>votre panier:</b></td>
                                        </tr>
                                        <tr>
                                            <td width="44%" bgcolor="#CCCCCC"><b>Réf. différentes</b></td>
                                            <td width="56%" bgcolor="#CCCCCC"><% out.print(session.getAttribute("panierQuantite"));%></td>
                                        </tr>
                                        <tr>
                                            <td bgcolor="#CCCCCC"><b>Prix total</b></td>
                                            <td bgcolor="#CCCCCC"><% out.print(session.getAttribute("panierPrixTotal"));%></td>
                                        </tr>
                                    </table></td>
                            </tr>
                        </table></td>
                    <td width="10" rowspan="3" align="center" background="img/border_r.gif"></td>
                </tr>

                <tr>
                    <td height="34">
                        <table width="800" colspan="7" border="0" cellpadding="1" bgcolor="#8CC63E">
                            <tr>
                                <td>
                                    <ul id="navigation">
                                        <li><a href="/BMGweb/Magasin?action=catalogue" title="home">HOME </a></li>
                                        <li><a href="/BMGweb/Magasin?action=panier" title="panier">PANIER </a></li>
                                        <li><a href="/BMGweb/Magasin?action=commande" title="commander">COMMANDER</a></li>
                                    </ul></td>
                            </tr>
                        </table>
                        <p>Gestion de votre panier</p>
                        <table width="800" colspan="7" border="0" cellpadding="1" bgcolor="#8CC63E">
                            <tr>
                                <td></td>
                            </tr>
                        </table></td>

                </tr>


                <tr>
                    <td valign="top">
                        <table width="800" border="0" cellpadding="5">
                            <tr>
                                <td colspan="6" bgcolor="#CCCCCC"><b>Produits dans votre panier</b></td>
                            </tr>
                            <tr>
                                <td width="260" bgcolor="#CCCCCC"><p>Produit</p></td>
                                <td width="220" bgcolor="#CCCCCC"><p>Quantité commandée</p></td>
                                <td width="63" bgcolor="#CCCCCC"><p>Prix total</p></td>
                                <td bgcolor="#CCCCCC"><p></p></td>
                            </tr>




                            <% if (session.getAttribute("panier") != null)
                                    for (Panier_Entite p : (List<Panier_Entite>) session.getAttribute("panier")) {%>
                            <tr class="article">

                                <td><p><% out.print(p.getUnProduit().getIntitule());%></p></td>
                                <td><p>
                                    <form action="/BMGweb/Magasin" method="get">
                                        <input type="hidden" name="action" value="modifierQuantiteDuPanier" />
                                        <input type="hidden" name="article" value="<% out.print(p.getUnProduit().getIdProduit());%>" />
                                        <input type="text" size="1" name="quantite_panier" id="quantite_panier" value="<% out.print(p.getQuantite());%>">
                                        <input type="submit" name="modif_qte" id="modif_qte" value="Modifier la quantité">
                                    </form>
                                    </p></td>
                                <td><p><% out.print(p.getUnProduit().getPrix() * p.getQuantite());%></p></td>
                                <td><p>
                                    <form action="/BMGweb/Magasin" method="get">
                                        <input type="hidden" name="action" value="supprimerDuPanier" />
                                        <input type="hidden" name="article" value="<% out.print(p.getUnProduit().getIdProduit());%>" />
                                        <input type="submit" name="supp_panier" id="supp_panier" value="Supprimer du panier">
                                    </form>
                                    </p></td>

                            </tr>
                            <% }%>

                            <tr>
                            <form action="/BMGweb/Magasin" method="get">
                                <input type="hidden" name="action" value="viderLePanier" />
                                <td colspan="4"><input type="submit" name="viderPanier" id="viderPanier" value="Vider le panier"></td>
                            </form>
                </tr>
            </table>
            <table width="800" colspan="7" border="0" cellpadding="1" bgcolor="#8CC63E">
                <tr>
                    <td></td>
                </tr>
            </table>
        </td>
    </tr>
</table>
</div>
</body>
</html>